<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../../libs/mui.min.css" rel="stylesheet" />
		<link href="../../css/main.css" rel="stylesheet" />
		<link rel="stylesheet" href="../../css/mine-commision.css" />
	</head>

	<body>
		<div class="head">
			<img id="back" src="../../images/all-left.png" alt="">
			<p>我的佣金</p>
			<div class="head-title">
				<img src="../../images/phone.png" alt="" height="20%" />
				<span id="commision-list" onclick="href('mine-commision-list.html')">账单</span>
			</div>
		</div>

		<div class="content">
			<div class="content-top">
				<p class="content-top-money">本月收入(元)</p>
				<p class="content-top-num">3,000</p>
				<p class="content-top-all">累计收入 ¥<span>10,000</span></p>
			</div>
			<div id="commision-bank" onclick="href('mine-commision-bank.html')" class="content-center">
				<img src="../../images/mine-cash.png" alt="" height="35%" />
				<span>提现</span>
				<img src="../../images/right-back.png" alt="" height="50%" class="right-back" />
			</div>
		</div>

		<script src="../../js/jquery-3.1.1.min.js"></script>
		<script src="../../libs/mui.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/url.js"></script>
		<script type="text/javascript">
			$('#back').on('tap',function() {
				mui.back()
			})
			$.ajax({
				type: "get",
				url: ur + "rest/commissionController/sumList",
				async: true,
				headers: {
					"X-Token": localStorage.token
				},
				success: function(data) {
					var data=JSON.parse(data);
					if(data.meta.code==='S002'){
						//如果为null则为0；
						for(var key in data.data){
							if(data.data[key]==null){
								data.data[key]=0;
							}
						}
						$(".content-top-all span").text(data.data.allincome);
						$('.content-top-num').text(data.data.monthincome)
					}else{
//						mui.toast(data.meta.message);
					}
				}
			});
		</script>
	</body>

</html>